using System;
using System.Collections.Generic;
using UMC.Data;
namespace UMC.ITME.Entities
{
    public partial class ProxySite
    {
        readonly static Action<ProxySite, object>[] _SetValues = new Action<ProxySite, object>[] { (r, t) => r.ConfigKey = Reflection.ParseObject(t, r.ConfigKey), (r, t) => r.Domain = Reflection.ParseObject(t, r.Domain), (r, t) => r.ProxyIP = Reflection.ParseObject(t, r.ProxyIP), (r, t) => r.RecursiveQuery = Reflection.ParseObject(t, r.RecursiveQuery), (r, t) => r.Type = Reflection.ParseObject(t, r.Type) };
        readonly static string[] _Columns = new string[] { "ConfigKey", "Domain", "ProxyIP", "RecursiveQuery", "Type" };
        protected override void SetValue(string name, object obv)
        {
            var index = Utility.Search(_Columns, name, StringComparer.CurrentCultureIgnoreCase);
            if (index > -1) _SetValues[index](this, obv);
        }
        protected override void GetValues(Action<String, object> action)
        {
            AppendValue(action, "ConfigKey", this.ConfigKey);
            AppendValue(action, "Domain", this.Domain);
            AppendValue(action, "ProxyIP", this.ProxyIP);
            AppendValue(action, "RecursiveQuery", this.RecursiveQuery);
            AppendValue(action, "Type", this.Type);
        }

        protected override RecordColumn[] GetColumns()
        {
            var cols = new RecordColumn[5];
            cols[0] = RecordColumn.Column("ConfigKey", this.ConfigKey);
            cols[1] = RecordColumn.Column("Domain", this.Domain);
            cols[2] = RecordColumn.Column("ProxyIP", this.ProxyIP);
            cols[3] = RecordColumn.Column("RecursiveQuery", this.RecursiveQuery);
            cols[4] = RecordColumn.Column("Type", this.Type);
            return cols;
        }

    }
}
